<template>
    <el-tree
            :data="data"
            :props="defaultProps"
            @node-click="handleNodeClick"
            node-key="name"
            :default-expanded-keys="['icd10']"
    ></el-tree>
</template>

<script>
    import icd10 from "../assets/icd10.json";

    export default {
        name: "ICD10TreeView",
        data() {
            return {
                data: [],
                defaultProps: {
                    children: 'children',
                    label: 'name'
                }
            };
        },
        mounted() {
            this.data = icd10;
        },
        methods: {
            handleNodeClick(data) {
                console.log(data);
            },
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }
</script>

<style scoped>

</style>